import { Injectable } from '@nestjs/common';
import NodeAuth from 'simp-node-auth';
import * as uuidv4 from 'uuid';

@Injectable()
export class ToolService {
  private nodeAuth: NodeAuth;
  constructor() {
    this.nodeAuth = new NodeAuth();
  }
  makePassword(password: string): string {
    return this.nodeAuth.makePassword(password);
  }

  checkPassword(password: string, sqlPassword: string): boolean {
    return this.nodeAuth.checkPassword(password, sqlPassword);
  }
 
  public get uuidToken(): string {
    return uuidv4.v4().replace(/-/g, '');
  }
  
}
